<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>婚庆公司后台管理</title>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/common.css" />
<link rel="stylesheet" href="css/font-awesome.min.css" />
</head>  
<body>
	<div class="wrap login_wrap">
		<div class="content">
			<div class="logo"></div>
			<div class="login_box">

				<div class="login_form">
					<div class="login_title">管理登录</div>

					<div class="form_text_ipt">
						<input name="username" id="username" type="text" placeholder="用户名">
					</div>
					<div class="ececk_warning">
						<span>用户名不能为空</span>
					</div>
					<div class="form_text_ipt">
						<input name="password" id="password" type="password"
							placeholder="密码">
					</div>
					<div class="ececk_warning">
						<span>密码不能为空</span>
					</div>
					<div class="form_check_ipt">
						<div class="left check_left">
							<label><input name="" type="checkbox"> 下次自动登录</label>
						</div>
						<div class="right check_right">
							<a href="#">忘记密码</a>
						</div>
					</div>
					<div class="form_btn">
						<button type="submit" id="submit">登录</button>
					</div>
					<!--<div class="form_reg_btn">
								<span>还没有帐号？</span><a href="register.html">马上注册</a>
							</div>-->
					<div class="other_login">
						<div class="left other_left">
							<!--<span>其它登录方式</span>-->
						</div>
						<div class="right other_right">
							<!--<a href="#"><i class="fa fa-qq fa-2x"></i></a>
								<a href="#"><i class="fa fa-weixin fa-2x"></i></a>
								<a href="#"><i class="fa fa-weibo fa-2x"></i></a>-->
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/common.js"></script>

	<div style="text-align: center;"></div>

	<script>
		$(function() {
			$("#submit").click(function() {

				var adm_Name = $("#username").val();
				var adm_Pwd = $("#password").val();

				$.ajax({
					type : "post",
					dataType : "json",
					url : "${pageContext.request.contextPath}/loginAdmin.do",
					data : {
						adm_Name : adm_Name,
						adm_Pwd : adm_Pwd,
					},
					success : function(msg) {
						if (msg.admin != null) {
							location.href = "index.jsp";
						} else {
							alert("密码或者用户名错误");
						}

					}
				});

			});
		});
	</script>

</body>
</html>
